<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<load href="__PUBLIC__/common.css"/>
	<load href="__PUBLIC__/Admin/resources/scripts/jquery-1.7.2.min.js"/>
	<load href="__PUBLIC__/Boot/bootstrap.min.css"/>
	<load href="__PUBLIC__/Boot/bootstrap.min.js"/>
	<load href="__PUBLIC__/Button/css/font-awesome.min.css"/>
	
</head>
<body>
	<div>
		<p>
 		 <button type="button" class="btn btn-primary ">内容列表</button>
 		 <a href="{:U('Content/add',array('cid'=>$_GET['cid']))}" class="btn btn-info" >添加内容</a>
		</p>
	</div>
	<!-- 模型缓存 -->
	<script type="text/javascript">
	function cache(obj){
		$.get("{:U('Category/updateCache')}",function(data){
			if(data==1){
				$(".Upcache").fadeIn('2000').fadeOut('1000');
			}else{
				$(".Upcache").html("缓存失败");
				$(".Upcache").fadeIn('1000').fadeOut('1000');
			}
		})
	}
	</script>

	<div class="table-responsive">
  		<table class="table table-striped">
    		<tr>
				<td class="w30">contid</td>
				<td class="w30">cid</td>
				<td class="w500">标题</td>
				<td class="w100">图片</td>
				<td class="w100">作者</td>
				<td class="w200">修改时间</td>
				<td >操作</td>

			</tr>
			<volist name="content" id="c">
			<tr>
				<td>{$c.contid}</td>
				<td>{$c.cid}</td>
				<td>{$c.title}&nbsp[<span style="font-size:12px;color:red;padding:5px;font-weight: 700;">{$c.flag}</span>]</td>
				<td>
					<if  condition="$c.thumb eq ''">
						无图
					<else/>
						<img style="width:30px;height:30px;" src="__ROOT__ /{$c.thumb}">
					
					</if>
				</td>
				<td >
					admin
				</td>
				<td>
					{$c.addtime|date="y-m-d h:i:s",###}
				</td>
				<td class="w300">
					<!-- {:U('category/addcate',array('cid'=>$c['cid']))} -->
					
					<a href="{:U('edit',array('contid'=>$c['contid'],'cid'=>$c['cid']))}"   class="btn btn-default  icon-edit" >编辑</a>
					<a href="javascript:;"  attr="{$c.cid}" contid="{$c.contid}" onclick="return del(this)" class="btn btn-default  icon-cut">删除</a>
				</td>
			</tr>
			</volist>
  		</table>
	</div>

<!-- 删除 -->
<script type="text/javascript">
	function del(obj){
		if(confirm('确认要删除吗？')){
			var cid = $(obj).attr('attr');
			var contid=$(obj).attr('contid');
			$.post("{:U('del')}",{contid:contid,cid:cid},function(data){
				if(data==1){
					$(obj).parent('td').parent('tr').remove();
				}
			})
		}
		return false;
	}
</script>




</body>
</html>
